import { formatTime } from '@/utils'
import i18n from '@/locales/index'
const { t } = i18n.global

export const listColumns = [
  { title: t('other.HangerNo'), dataIndex: 'hangerNo', key: 'hangerNo', align: 'center', width: 60 },
  {
    title: t('hangManage.productionInfo'), align: 'center', children: [
      { title: t('hangManage.makeNo'), dataIndex: 'moNo', key: 'moNo', align: 'center', width: 120 },
      { title: t('basicData.styleNo'), dataIndex: 'styleNo', key: 'styleNo', align: 'center', width: 120 }, 
      { title: t('basicData.color'), dataIndex: 'color', key: 'color', align: 'center', width: 120 },
      { title: t('basicData.size'), dataIndex: 'size', key: 'size', align: 'center', width: 120 },
      { title: t('hangManage.poNo'), dataIndex: 'poNo', key: 'poNo', align: 'center', width: 120 }, 
      { title: t('hangManage.bedNo'), dataIndex: 'lot', key: 'lot', align: 'center', width: 120 }, 
      { title: t('hangManage.cut'), dataIndex: 'cutNo', key: 'cutNo', align: 'center', width: 120 }, 
    ]
  },
  {
    title: t('hangManage.productInfo'), align: 'center', children: [
      { title: t('hangManage.road'), dataIndex: 'roadmap', key: 'roadmap', align: 'center', width: 120 },
      { title: t('hangManage.stationNo'), dataIndex: 'stationNo', key: 'stationNo', align: 'center', width: 120 },
      { title: t('basicData.staffName'), dataIndex: 'staffName', key: 'staffName', align: 'center', width: 120 },
      { title: t('basicData.processNo'), dataIndex: 'processNo', key: 'processNo', align: 'center', width: 120 },
      { title: t('basicData.processNames'), dataIndex: 'processName', key: 'processName', align: 'center', width: 120 },
      {
        title: t('hangManage.intoStationTime'), dataIndex: 'inTime', key: 'inTime', align: 'center', width: 170, timeType: 'time',
        customRender: ({ text }) => {
          return formatTime(text, 'YYYY-MM-DD HH:mm:ss')
        }
      },
      {
        title: t('hangManage.leaveStationTime'), dataIndex: 'leaveTime', key: 'leaveTime', align: 'center', width: 170, timeType: 'time',
        customRender: ({ text }) => {
          return formatTime(text, 'YYYY-MM-DD HH:mm:ss')
        }
      }
    ]
  }  
]

export const hangerDetailSParams = [
  { title: t('hangManage.makeNo'), key: 'moNo', disabled: true, show: true, type: 'input' },
  { title: t('basicData.styleNo'), key: 'styleNo', show: true, type: 'input' },
  { title: t('other.HangerNo'), key: 'hangerNo', show: false, type: 'input', maxLength: 10 },
  { title: t('basicData.color'), key: 'color', type: 'input' },
  { title: t('basicData.size'), key: 'size', type: 'input' },
  { title: t('hangManage.poNo'), key: 'poNo', type: 'input' },
  { title: t('hangManage.bedNo'), key: 'lot', type: 'input' },
  { title: t('hangManage.cut'), key: 'cutNo', type: 'input' },
  { title: t('hangManage.road'), key: 'roadmap', type: 'input' },
  { title: t('hangManage.stationNo'), key: 'stationNo', type: 'cascader' },
  { title: t('basicData.processNames'), key: 'processName', type: 'input' },
  { title: t('basicData.processNo'), key: 'processNo', type: 'input' },
  { title: t('hangManage.intoStationTime'), key: 'inTime', type: 'time' },
  { title: t('hangManage.leaveStationTime'), key: 'leaveTime', type: 'time' }

]